package com.starfactory.customer.controller;

import com.starfactory.common.shared.ResponseInfo;
import com.starfactory.customer.api.DeviceConfigDeteled;
import com.starfactory.customer.shared.dto.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class DeviceConfigDeteledApiController {
    @Autowired private DeviceConfigDeteled deviceConfigDeteled;
    @PostMapping("/customer/api/deviceConfigDeteledApiApiFunction")
    public ResponseInfo<Boolean> deviceConfigDeteledApiApiFunction(
            @RequestParam(value = "deviceConfigId") Long deviceConfigId){
        Result<Boolean> result = deviceConfigDeteled.deviceConfigDeteled(deviceConfigId);
        if (result.getData()){
            return ResponseInfo.success(result.getData());
        }else {
            return ResponseInfo.fail(String.valueOf(result.getCode()), result.getMessage());
        }
    }
}
